//
// Created by 123 on 2024/12/26.
//
#include "stdio.h"

union Data{
    int intValue;
    float floatValue;
    char charValue;
};


int main068(){
    union Data data;
    //存储整数
    data.intValue = 100;
    printf("int :%d\n",data.intValue);
    //存储浮点数,覆盖之前整数值
    data.floatValue = 99.2;
    printf("float :%.2f\n",data.floatValue);
    //存储字符，覆盖之前的浮点数值
    data.charValue = 'A';
    printf("char :%c\n",data.charValue);

    printf("================spit================\n");
    printf("int :%d\n",data.intValue);
    printf("float :%.2f\n",data.floatValue);
    printf("char :%c\n",data.charValue);


    return 0;
}